/**
 * author:Administrator
 * date:2016/2/25
 * desc:TODO
 */

'use strict';

let Repo = require('./CategoryRepo.js');

let ROOT_PID = 0;

class Category {
  constructor(pojo) {
    pojo = pojo || {};
    this.id = pojo.id;
    this.pid = pojo.pid || ROOT_PID;
    this.name = pojo.name;
  }

  * store() {
    return yield Repo.store(this);
  }
}

module.exports = Category;